package Client;

import java.io.Serializable;

public class Time implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Long time = (long) 0;
	
	public Time() {}
	
	public Time(Integer h, Integer m, Integer s, Integer ms) {
		this.time = (long) ((h*3600000) + (m*60000) + (s*1000) + (ms));
	}
	
	public void setTime(Integer h, Integer m, Integer s, Integer ms) {
		this.time = (long) ((h*3600000) + (m*60000) + (s*1000) + (ms));
	}
	
	public Integer getHours() {
		return (int) (time/1000/60/60);
	}
	
	public Integer getMinutes() {
		return (int) (((time/1000)/60)%60);
	}
	
	public Integer getSeconds() {
		return (int) ((time/1000)%60);		
	}
	
	public Integer getMilliseconds() {
		return (int) (time%1000);		
	}
	
	public Long getComparable() {
		return time;
	}
	
	public String getTimeStamp() {		
		String result = "" +getHours()+ ":" +getMinutes()+ ":" +getSeconds()+ "." +getMilliseconds();	
		
		return result;
	}
}
